Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add basic syntax highlighting of code blocks with highlight.js #54

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

thavelick
Copy link

@thavelick thavelick commented May 26, 2023

for #35

This implementation works but has a few potential issues that may or may not be a problem for the maintainers:

  1. There's a typescript error because the <Code> component expects children, but we can't provide both children and dangerouslySetHtml
  2. There may be a better way to exclude children from props before passing them to <Code>.
  3. There may be a better way to convert children to a string before passing to hljs.
  4. The background color for code blocks seems to come from the markdown display library rather than hljs. With the github.css theme currently used this looks fine, but other hljs themes can look pretty bad as they expect a black background.

@thavelick
Copy link
Author

Also - not sure if I should be including the changes to package-lock.json and yarn-lock.json. Let me know if I should exclude those

@OctopBP OctopBP mentioned this pull request Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant